package com.mmall.service;

import com.mmall.common.ServerResponse;
import com.mmall.pojo.User;
import org.apache.ibatis.annotations.Param;

/**
 * @author zhangxiaolin@zhonhajt.com
 * @Title: 用户业务实现
 * @Package com.mmall.service
 * @Description:
 * @date 2018/9/5 11:24
 */
public interface IUserService {

    /**
     * 登录
     * @param username
     * @param password
     * @return
     */
    public ServerResponse<User> login(String username, String password);

    /**
     * 注册
     * @param user
     * @return
     */
    public ServerResponse<String> register(User user);

    /**
     * 校验邮箱或者用户名
     * @param str
     * @param type
     * @return
     */
    public ServerResponse<String> checkValid(String str, String type);


    /**
     * 查询忘记密码问题
     * @param username
     * @return
     */
    public ServerResponse<String> selectQuestion(String username);

    /**
     * 校验问题
     * @param username
     * @param question
     * @param answer
     * @return
     */
    public ServerResponse<String> checkAnswer(String username, String question, String answer);

    /**
     * 重设密码
     * @param username
     * @param newPassword
     * @param forgetToken
     * @return
     */
    public ServerResponse<String> forgetResetPassword(String username, String newPassword, String forgetToken);
}
